package util;


public abstract class StoichiometryCalculatorAbstraction {

	Equation equation;
	
	
	public StoichiometryCalculatorAbstraction(Equation equation){
		this.equation = equation;
	}
	
	/**
	 * Returns the mol of target according to passed mass.
	 * 
	 * @param target a Molecule in the equation.
	 * @param massOfTarget mass of target
	 */
	abstract public double massToMol(Molecule target,double massOfTarget);
	
	/**
	 * Returns the mole of target according to passed volume.
	 * 
	 * @param target a Molecule in the equation.
	 * @param volumeOfTarget volume of target
	 */
	abstract public double volumeToMole(Molecule target,double volumeOfTarget);
	
	/**
	 * Returns the mol of destination molecule based on the source.  The source must be the limiting reactant if there is one.
	 * 
	 * @param source a Molecule in the equation with a set mol value
	 * @param destination a Molecule in the equation
	 */
	abstract public double molToMol(Molecule source,double mols, Molecule destination);
	
	/**
	 * Uses the left side of the Equation to find the limiting reactant
	 * 
	 * @return null if none, the reactant if there is one
	 */
	abstract public Molecule getLimitingReactant();
	
	/**
	 * A helper method to get the molar mass.
	 * 
	 * @param source a valid Molecule.
	 * @return double containing the Molar mass of source.
	 */
	abstract protected double getMolarMass(Molecule source);
}
